
BEGIN TRANSACTION
GO
ALTER TABLE dbo.Items ADD
	CRate numeric(9, 2) NOT NULL CONSTRAINT DF_Items_CRate DEFAULT 0
GO
COMMIT

----------------------------------------

ALTER VIEW [dbo].[vw_Items]
AS
SELECT     dbo.Items.GroupID, dbo.Groups.GroupCode, dbo.Groups.GroupName, dbo.Groups.GroupNameUrdu, dbo.Groups.Type, dbo.Items.UnitID, dbo.Unit.UnitCode, dbo.Unit.UnitName, 
                      dbo.Unit.UnitNameUrdu, dbo.Unit.Scale, dbo.Items.ItemID, dbo.Items.ItemCode, dbo.Items.ItemName, dbo.Items.ItemNameUrdu, dbo.Items.Discontinue, dbo.Items.PRate, dbo.Items.SRate, 
                      dbo.Items.ArticleNo, dbo.Items.CRate
FROM         dbo.Unit RIGHT OUTER JOIN
                      dbo.Items ON dbo.Unit.UnitID = dbo.Items.UnitID LEFT OUTER JOIN
                      dbo.Groups ON dbo.Items.GroupID = dbo.Groups.GroupID
